<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>修改个人信息</title>

    <!-- Bootstrap -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">

    <!-- HTML5 shim 和 Respond.js 是为了让 IE8 支持 HTML5 元素和媒体查询（media queries）功能 -->
    <!-- 警告：通过 file:// 协议（就是直接将 html 页面拖拽到浏览器中）访问页面时 Respond.js 不起作用 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
    <![endif]-->

    <!--引入字体图标相关的样式文件-->
    <link href="//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
	
	<link rel="stylesheet" type="text/css" href="css/rv.css"/>

</head>
<body>

<div id="rv_box" class="container">
	<form action="rv">
		<div id="rv_left">
			<div class="col-md-2">
				<div id="oDiv"></div>
				<a href="javascript:" class="file">选择头像
					<input type="file" name="avatar" id="oInput">
				</a>
			</div>
		</div>

		<div id="rv_right">
			<div id="rv_right_input">
				<h3>个人信息修改</h3 >
				<div id="">昵&ensp;&ensp;称:<input type="text" name="nickname" id="" value="" required placeholder = "请输入昵称"/></div>
				<div id="">年&ensp;&ensp;龄:<input type="number" name="age" id="" value=""  required placeholder = "请输入年龄"/></div>
			</div>
			<div id="rv_right_button">
				<div id="a11"><input type="reset" name="" class="btn btn-danger" value="重置" /></div>
				<div id=""><input type="button" name="" class="btn btn-info" value="注册" /></div>
				<div id=""><input type="submit" name="" class="btn btn-info" value="提交" /></div>
			</div>

		</div>
	</form>

</div>




<!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
<script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
<!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>
<script>

	document.getElementById("oInput").addEventListener("change",function(e){
		var files = this.files;
		var img = new Image();
		var render  = new FileReader();
		render.readAsDataURL(files[0]);
		render.onloadstart = function(){
		};
		render.onload = function(){
			img.src = this.result;
			img.style.height = "100%";
			img.style.width = "100%";
			var oDiv = document.getElementById("oDiv");
			oDiv.innerHTML = "";
			oDiv.appendChild(img);
		};
		render.onloadend = function(){
		}
	});


</script>
</body>
</html>